﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MovieCtrlService;
using ScheduleCtrlService;
using ModelLayer;

public partial class _Default : System.Web.UI.Page
{
	private ScheduleCtrlClient scheduleClient;
	protected void Page_Load(object sender, EventArgs e)
	{
		
	}

	public void printSchedulesList ()
	{
		if (scheduleClient == null) scheduleClient = new ScheduleCtrlClient();
		Schedule[] schedules = scheduleClient.getSchedules();
		foreach (Schedule schedule in schedules)
		{
			Response.Write("<div class='result'>" + 
							"<div id='date' class='resultDate'>" +
								schedule.time.DayOfWeek.ToString() + " <br/>" +
								schedule.time.ToShortDateString() + " " + schedule.time.ToShortTimeString() + " " +
							"</div>" +
							"<div class='resultImage'><img class='stretch' alt='' src='Styles/images/img.jpg'/></div>" +
							"<div class='resultInfo'><b id='name' class='f16'>" + schedule.movie.name + "</b><br/><span id='description' class='description f12'>Description: <i>" + schedule.movie.description + "</i></span></div>" +
							"<div class='resultButton'><button class='buyButton gRed' onclick='return show_reserve(" + schedule.id + ", \"" + schedule.movie.name + "\", \"" + schedule.time + "\");'>Reserve</button></div>" +
							"</div>");
		}
	}
}
